import request from '@/utils/request'
// ===========企业管理===============
// 招聘企业列表
export function getCompanyList() {
  return request({
    url: '/ejob/jobCompany/list',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get'
  })
}
// 招聘企业分页列表
export function getCompanyListPage(params) {
  return request({
    url: '/ejob/jobCompany/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params: params
  })
}
// post-新增招聘企业 put=修改 delete=删除
export function dealCompanyMsg(msg, params) {
  return request({
    url: '/ejob/jobCompany',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: msg,
    data: params
  })
}

// 删除招聘企业
export function deleteCompany(params) {
  return request({
    url: '/ejob/jobCompany',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'delete',
    data: params
  })
}
//获取劳务派遣公司列表
export function getDispatchList() {
  return request({
    url: '/ejob/jobDispatchInstitution/list',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get'
  })
}
// ====================招聘发布管理==============
// 招聘需求分页列表
export function getJobCompanyList(params) {
  return request({
    url: '/ejob/jobOffers/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params: params
  })
}

// 岗位类型列表
export function getJobCategory(params) {
  return request({
    url: '/ejob/jobCategory/list',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
    params: params
  })
}
//岗位亮点分页列表
export function getJobStrengthList() {
  return request({
    url: '/ejob/jobStrengths/pub/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': 0,
      'pageSize': 1000
    },
    method: 'get',
  })
}
//查看岗位详情/编辑岗位详情
export function getJobInfo(params) {
  return request({
    url: '/ejob/jobOffers/get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
    method: 'get',
    params: params
  })
}
//新增岗位亮点
export function addJobStrength(data) {
  return request({
    url: '/ejob/jobStrengths',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}
//置顶岗位
export function makeJobTop(data) {
  return request({
    url: '/ejob/jobOffers/top',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
      // 'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    params: data
  })
}
// 新增招聘需求
export function addJobOffers(data) {
  return request({
    url: '/ejob/jobOffers',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}

// 修改招聘需求
export function modifyJobOffers(data) {
  return request({
    url: '/ejob/jobOffers',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data
  })
}

// 批量暂停
export function showJobOffers(data, show) {
  return request({
    url: '/ejob/jobOffers/show?show=' + (show ? 1 : 0),
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data: data
  })
}

// ==========简历管理==============
// 简历投递记录分页列表
export function getJobOffersRecord(data) {
  return request({
    url: '/ejob/jobOffersRecord/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': data.pageNum,
      'pageSize': data.pageSize
    },
    method: 'get',
    params: data
  })
}
// 岗位名称检索列表
export function getJobCategoryOffices() {
  return request({
    url: '/ejob/jobOffersRecord/offers',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get'
  })
}

// 修改简历投递人状态
export function editJobOffersRecord(data) {
  return request({
    url: '/ejob/jobOffersRecord/update',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data
  })
}

// 导出excel
export function exportExcel(data) {
  return request({
    url: '/ejob/jobOffersRecord/export',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': data.pageNum,
      'pageSize': data.pageSize
    },
    method: 'get',
    params: data
  })
}


// 信息采集 列表查询
export function getInfoList(data) {
  return request({
    url: '/ejob/jobData/listPage',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': data.pageNum,
      'pageSize': data.pageSize
    },
    params:data,
    method: 'get'
  })
}
// 新增
export function addUserInfo(data) {
  return request({
    url: '/ejob/jobData',
    data:data,
    method: 'post'
  })
}

// 新增
export function putUserInfo(data) {
  return request({
    url: '/ejob/jobData',
    data:data,
    method: 'put'
  })
}
// 导入
export function uploadEx(data) {
  return request({
    url: '/ejob/jobData/upload',
   headers: {
     'Content-Type': 'multipart/form-data'
   },
   method: 'post',
   data: data
  })
}

// 导出
export function exportEx(data) {
  return request({
    url: '/ejob/jobData/export',
   headers: {
      // 'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': 0,
      'pageSize': 5000
   },
   method: 'get',
   data: data,
    responseType: 'blob'
  })
}
